﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddProduct.aspx.cs" Inherits="admin_AddProduct" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    
    <link rel="Stylesheet" type="text/css" href="../Styles/right_style.css" />
    <script type="text/javascript" src="../Scripts/jquery.ui/js/jquery.js"></script>

    <style type="text/css">
        <!--
        html{ scrollbar-base-color: #dbecf8; scrollbar-arrow-color: #2a8ed1; scrollbar-track-color: #bdddf2; scrollbar-3dlight-color: #2886c5; scrollbar-darkshadow-color: #2886c5;
        scrollbar-face-color: #dbecf8; scrollbar-shadow-color: #dbecf8;  }
        -->
        </style>

</head>
<body>
    <form id="form1" runat="server">
            <div class="sub_right_top">
  <div class="hdm_header" >
    <div class="tb1_on"><h2 class="h2_icon">产品信息管理</h2></div>

    <div class="clear"></div>
  </div>
  <div class="hdm_footer">
    <div style="height:13px; overflow:hidden;"></div>            
    <table width="97%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#77acd0" style="border-collapse:collapse; ">
      <tr bgcolor="#b1d5ef">
        <td colspan="2"><asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="14px" ForeColor="Black"></asp:Label></td>
        </tr>
      <tr>
        <td width="120">产品名称：</td>
        <td>
          <asp:TextBox ID="txtProductName" runat="server" Width="80%"></asp:TextBox> 
            </td>
      </tr>
      <tr>
        <td width="120">产品型号：</td>

        <td>
          <asp:TextBox ID="txtProductType" runat="server" Width="80%"></asp:TextBox>        
        </td>
      </tr>
      <tr>
        <td width="120">计量单位：</td>
        <td>
          <asp:TextBox ID="txtComputation" runat="server" Width="80%"></asp:TextBox>    
           </td>

      </tr>
      <tr>
        <td width="120">成本价：</td>
        <td>
          <asp:TextBox ID="txtCostPrice" runat="server" Width="80%"></asp:TextBox>        
          </td>
      </tr>
      <tr>
        <td>出售价：</td>

        <td>
          <asp:TextBox ID="txtSalePrice" runat="server" Width="80%"></asp:TextBox>      
         </td>
      </tr>
      <tr>
        <td>产品描述：</td>
        <td>
          <asp:TextBox ID="txtDescription" runat="server" Width="80%"></asp:TextBox>     
         </td>

      </tr>
      <tr>
        <td width="120">供应商：</td>
        <td><div class="disk_liulan_one">
            <asp:TextBox ID="txtSupply" runat="server" ReadOnly="True" Width="80%"></asp:TextBox>
        </div>
          <div class="disk_liulan_tow">
            <asp:Button ID="Button1" runat="server" Text="" CssClass="contact_xuanze" CausesValidation="False" OnClientClick="val = window.showModalDialog ('SelectSupply.aspx', '','status:no;center:yes;scroll:yes;resizable:no;help:no;dialogWidth:400px;dialogHeight:300px');document.getElementById('txtSupply').value = val[1];document.getElementById('hidSupplyId').value = val[0];return false;" />         
          </div> </td>
      </tr>      
      <tr bgcolor="#b1d5ef">
        <td colspan="2" align="center"><div class="disk_queding_top">
            <asp:Button ID="Button3" runat="server" OnClick="Button2_Click" Text="" CssClass="queding_anniu" OnClientClick="return checkfrm()" />
        </div>

          <div class="disk_back_top">
            <asp:Button ID="Button2" runat="server" CausesValidation="False" PostBackUrl="~/admin/FindBlurProduct.aspx"
                                    Text="" CssClass="fanhui_anniu"/>
          </div></td>
        </tr>
    </table>
    <div style="height:15px; overflow:hidden;"></div>
  </div>
</div>
        <asp:HiddenField ID="hidSupplyId" runat="server" />
    </form>
</body>
</html>
<script type="text/javascript">
    function checkfrm()
    {
        if(document.getElementById('txtProductName').value=='')
        {
            alert('产品名称不能为空！');
            return false;
        }
        if(document.getElementById('txtSupply').value=='')
        {
            alert('请选择供应商！');
            return false;
        }
        var reval=/^\d{1,18}(\.\d{1,2})?$/;
        if(document.getElementById('txtCostPrice').value != '')
        {
            if(!reval.test(document.getElementById('txtCostPrice').value))
            {
                alert('成本价格式不正确！（最多2位小数）');
                return false;
            }
        }
        if(document.getElementById('txtSalePrice').value != '')
        {
            if(!reval.test(document.getElementById('txtSalePrice').value))
            {
                alert('出售价格式不正确！（最多2位小数）');
                return false;
            }
        }
        return true;
    }
</script>
